<?php
/**
 *	[TWCMS] (C)2012 TongWang Inc.
 *	$Id: content_show.tpl.php 2 2013-04-27 07:14:17Z nanown@qq.com $
 */
	defined('IN_TWCMS') || exit('Access Denied');
	include load_tpl('head');
?>
	<div class="head">
		<dl>
			<input id="add" type="submit" value="发布" class="but1" />
			<dd class="on"><?=$this->title?></dd>
		</dl>
	</div>
	
	<div class="p c2">
		<div class="cc">
			<?php
				$conentArr = $this->get_content();
				if(empty($conentArr)) {
					skyTips('暂无内容');
				}else{
			?>
			<table class="tb2">
				<tr class="tit">
					<!-- <th width="25"><input type="checkbox" id="check_all"></th> -->
					<th width="50">ID</th>
					<th>标题</th>
					<th width="8%">点击</th>
					<th width="110">发布人</th>
					<th width="140">发布时间</th>
				</tr>
				<?php foreach ($conentArr as $arr){ ?>
				<tr class="li">
					<!-- <td><input type="checkbox" name="chk_row" value="<?=$arr['id']?>"></td> -->
					<td class="t_c"><?=$arr['id']?></td>
					<td class="t_l"><span style="margin-right:15px;"><a href="javascript:edit(<?=$arr['id']?>);">[编辑]</a> <a href="javascript:del(<?=$arr['id']?>,<?=$arr['cid']?>);">[删除]</a> <a href="index.php?u=<?=$this->G['url_show'].P.$arr['id']?>" target="_blank">[查看]</a></span><?=$arr['title']?></td>
					<td class="t_c"><?=$arr['view']?></td>
					<td class="t_c"><?=$arr['username']?></td>
					<td class="t_c"><?=date('Y-m-d H:i:s', $arr['time'])?></td>
				</tr>
				<?php } ?>
			</table>
			<div class="page"><?=$this->paging?></div>
			<?php } ?>
		</div>
	</div>

	<!-- <div class="foot">
		<a class="but2" href="">删除</a>
		<select class="sele1">
			<option value="">移动到</option>
		</select>
	</div> -->
</div>
<script type="text/javascript">
function edit(id) {
	parent.oneTab("?mod=content&action=show&do=edit&id="+id, true);
}

function del(id,cid) {
	twAjax.confirm("删除不可恢复，确定删除？", function(){
		twAjax.postd("?mod=content&action=show&do=ajax_del", {id:id,cid:cid}, function(data){
			twAjax.alert(data);
			if(window.twD.err==0) setTimeout("window.location.reload()",1100);
		});
	});
}

$("#add").click(function(){
	parent.oneTab("?mod=content&action=show&do=add", true);
});
</script>
</body>
</html>